package org.zhadoop.stream.cql.semanticanalyzer.parser.visitor;

import java.util.Locale;

import org.antlr.v4.runtime.misc.NotNull;
import org.zhadoop.stream.cql.semanticanalyzer.parser.CQLParser.ColumnALiasContext;
import org.zhadoop.stream.cql.semanticanalyzer.parser.context.SelectAliasContext;

/**
 * select 表达式别名语法结构解析
 * @author zwd
 *
 */
public class SelectAliasVisitor extends AbsCQLParserBaseVisitor<SelectAliasContext>{

	private SelectAliasContext context = null;
	
	public SelectAliasVisitor() {
		context = new SelectAliasContext();
	}
	
	@Override
	protected SelectAliasContext defaultResult() {
		return context;
	}
	
	@Override
	public SelectAliasContext visitColumnALias(@NotNull ColumnALiasContext ctx) {
		context.getAlias().add(ctx.getText().toLowerCase(Locale.US));
        return context;
	}

}
